package com.project.biz.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.project.biz.CmsWxPayNoticeBiz;
import com.project.entity.CmsWxPayNotice;
import com.project.mapper.CmsWxPayNoticeMapper;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @Description: 微信支付通知信息业务层接口实现类
 * @Author: zhuchi
 * @CreateDate: 2020/12/4 13:47
 * @Version: 1.0
 */
@Service
public class CmsWxPayNoticeBizImpl extends ServiceImpl<CmsWxPayNoticeMapper, CmsWxPayNotice> implements CmsWxPayNoticeBiz {

    /**
     * 添加微信支付异步通知信息
     * @param tradeType 交易类型(JSAPI:公众号支付,NATIVE:扫码支付,APP:app支付,MICROPAY:付款码支付,MWEB:H5支付,FACEPAY:刷脸支付)
     * @param noticeType 通知类型(1:商品支付,2:回收员充值)
     * @param noticeContent
     * @return
     */
    public int addWxPayNotice(String tradeType, Integer noticeType, String noticeContent){
        CmsWxPayNotice wxPayNotice = new CmsWxPayNotice();
        wxPayNotice.setTradeType(tradeType);
        wxPayNotice.setNoticeType(noticeType);
        wxPayNotice.setNoticeContent(noticeContent);
        wxPayNotice.setCreateTime(new Date());
        return this.baseMapper.insert(wxPayNotice);
    }

}
